<script setup>
import { ref, watch } from 'vue';

const count = ref(0)
const add = () => {
  count.value++
}
watch(count, (newValue, oldValue) => {
  console.log(`count发生了变化, 老值为${oldValue}, 新值为${newValue}`)
})
</script>

<template>
  <div class="app-page">
    {{ count }}
    <button @click="add">加一</button>
  </div>
</template>

<style scoped></style>
